

pdf(file="~/Dropbox/obstacles/code/replication/pics/strata.pdf")


par(mar=c(5,1,1,1))
plot(x=1:5, y=1:5, axes=F, xlab="",ylab="", col="white")
### interior colors
rect(xleft=2, ybottom=2.5, xright=3.5, ytop=4,  col="blue", density=10, angle=135, lty=2)
rect(xleft=2, ybottom=2.5, xright=3.5, ytop=4,  col="red", density=5, angle=135)
rect(xleft=2, ybottom=1, xright=3.5, ytop=2.5, col="blue", density=10, angle=135, lty=2)
rect(xleft=3.5, ybottom=2.5, xright=5, ytop=4, col="red", density=10, angle=135)
segments(x0=2, x1=5, y0=1, y1=1)
segments(x0=2, x1=5, y0=4, y1=4)
segments(x0=3.5, x1=3.5, y0=1, y1=4)
segments(x0=2, x1=5, y0=2.5, y1=2.5)
segments(x0=2, x1=2, y0=1, y1=4)
segments(x0=5, x1=5, y0=1, y1=4)
###interior labels
rect(xleft=2.25, ybottom=3, xright=3.25, ytop=3.5,  col="white", border="white")
rect(xleft=2.25, ybottom=1.5, xright=3.25, ytop=2,  col="white", border="white")
rect(xleft=3.75, ybottom=3, xright=4.75, ytop=3.5,  col="white", border="white")
#rect(xleft=3.75, ybottom=1.5, xright=4.75, ytop=2,  col="white", border="white")


##interior labels
text(x=2.75, y=3.25, labels="always-stop\n(e.g. violent crime)", cex=.95)
text(x=2.75, y=1.75, labels="stop only if white\n(?)", cex=.95)
text(x=4.25, y=3.25, labels="stop only if minority\n(e.g. \"furtive\n movements\")", cex=.95)
text(x=4.25, y=1.75, labels="never-stop\n(inconspicuous)", cex=.95)
##exterior labels
text(x=1.75, y=3.25, labels=expression("M"[i](1)~"="~ "1"))
text(x=1.75, y=1.75, labels=expression("M"[i](1)~"=" ~"0"))
text(x=4.25, y=4.25, labels=expression("M"[i](0)~"=" ~"0"))
text(x=2.75, y=4.25, labels=expression("M"[i](0)~"="~"1"))
par(xpd=TRUE)
legend(x=3, y=.75,col=c("red","blue"), lty=c(1,2),legend=c("observed minority encounters", "observed white encounters"), cex=.7)



dev.off()